import React, { useEffect } from 'react'
import Hls from 'hls.js'

export default function (videoRef: React.RefObject<HTMLVideoElement>) {
    useEffect(() => {
        const videoSrc = 'https://live.ce-safe.com/train/1208.m3u8?auth_key=1670567331-0-0-a2d27bc19057aa708992aa871130d764'
        const hls = new Hls();
        hls.loadSource(videoSrc);
        hls.attachMedia(videoRef.current);
    }, [])
}